package com.timebank.timecoin.pojo.entity;

import com.alibaba.fastjson2.JSON;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Objects;

/**
 * 智能合约 用户对象
 * @author shiliuyinzhen
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Data
@Accessors(chain = true)
public class User  implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 用户Id */
    private Long userId;

    /** 用户名 */
    private String userName;

    /** 时间币 */
    private Integer timeCoin;

    @Override
    public int hashCode() {
        return Objects.hash(getUserId(), getUserName(), getTimeCoin());
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
